﻿using Microsoft.Extensions.DependencyInjection;
using StartsEAS_API.BLL.Interfaces.IAlterStuB;
using StartsEAS_API.DAL.AlterStuD;
using StartsEAS_API.Model;
using StartsEAS_API.Model.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StartsEAS_API.BLL.AlterStuB
{
    public class AlterStuBLL : IAlterStuBLL
    {
        private readonly StarsEASContext _context;
        public AlterStuDAL _alterStuDal;
        public AlterStuBLL(IServiceScopeFactory context) {
            _context = context.CreateScope().ServiceProvider.GetRequiredService<StarsEASContext>();
            _alterStuDal = new(_context);
        }
        public ResultUtils AlterStuByStatus(int status)
        {
            return _alterStuDal.AlterStuByStatus(status);
        }

        public ResultUtils AlterStuCounselorApproval(string token, int status, string stuId)
        {
            return _alterStuDal.AlterStuCounselorApproval(token, status, stuId);
        }

        public ResultUtils AlterStuDeptApproval(string token, int status, string stuId)
        {
            return _alterStuDal.AlterStuDeptApproval(token, status, stuId);
        }

        public ResultUtils GetAllAlterStu()
        {
            return _alterStuDal.GetAllAlterStu();
        }

        public ResultUtils GetAllAlterStuByCounselor(string token)
        {
            return _alterStuDal.GetAllAlterStuByCounselor(token);
        }

        public ResultUtils GetAllAlterStuStatusIsNotOk()
        {
            return _alterStuDal.GetAllAlterStuStatusIsNotOk();
        }

        public ResultUtils GetAllTheRecordsByToken(string token)
        {
            return _alterStuDal.GetAllTheRecordsByToken(token);
        }

        public ResultUtils GetAlterStuByCounselor(string token)
        {
            return _alterStuDal.GetAlterStuByCounselor(token);
        }

        public ResultUtils GetAlterStuByStuId(string stuId)
        {
            return _alterStuDal.GetAlterStuByStuId(stuId);
        }

        public ResultUtils InsertAlterStu(AlterStu stu)
        {
            return _alterStuDal.InsertAlterStu(stu);
        }
    }
}
